/**
 * 
 *  @project Air Traff Monitor
 * 
 *  @author M.Emre ATASEVER <m.emre.atas@gmail.com>
 *  @author M.Burak ALKAN <mburakalkan@gmail.com>
 *  @author H.Burak KARAMIK <bkaramik@gmail.com>
 *
 *	`Air Traffic Monitor' is distributed in the hope that it will be useful,
 *	but WITHOUT ANY WARRANTY; without even the implied warranty of
 *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *	GNU General Public License for more details.
 *
 *	You should have received a copy of the GNU General Public License
 *	along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

#ifndef MWND_H
#define MWND_H

#include <QStatusBar>
#include <QMainWindow>
#include <QLabel>
#include <QDialog>
#include <QHBoxLayout>
#include <QSpinBox>

#include "netview.h"
#include "mwtoolbar.h"
#include "viewtoolbar.h"
#include "alertview.h"
#include "statview.h"
#include "about.h"
#include "graph.h"
#include "infoview.h"

class MainWindow : public QMainWindow
{
	Q_OBJECT
public:
	MainWindow(QKismetSocket *sock);
	~MainWindow();
	void setSTime(int stime);
	void setServerName(QString name);

	QKismetNetView *tv;
	QKismetMWToolBar tb;
	QKismetViewToolBar *vtb;
	QKismetPanelsToolBar pt;
	QKismetAlertDock *ald;
	QKismetGraphDock *gra;
	QKismetStatusDock *statd;
	QKismetInfoDock *info;

public slots:
	void showTime(int time);
	void showInfo(iInfo data);
	void showState(QAbstractSocket::SocketState s);
	void connectToHost();

private:
	int stime;
	QString servname;
	void readSettings();
	void writeSettings();
	void closeEvent(QCloseEvent *event);

	QKismetAboutDialog about;
	QKismetSocket *socket;

	QMenu mfile,mview;
	QAction aquit,aaqt,aabout,aconntoh;
	QLabel lstate,lnets;
	QLabel ltime;

};

class HostDialog : public QDialog
{
	Q_OBJECT
public:
	HostDialog(QWidget *parent);
	~HostDialog();

	QString getHost();
	int	getPort();
private:
	QHBoxLayout *layoutbut,*layouted;
	QVBoxLayout *layoutmain;
	QPushButton ok,cancel;
	QLineEdit edhost;
	QSpinBox edport;
	QLabel lhost,lport;
};
#endif
